package dataset;

public abstract class Dataset {
    public double[][] dataset = new double[0][0];
    public int[] label = new int[0];
    public int[] shape = new int[2];

    @Override
    public String toString() {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("dataset with " + shape[0] + " lines " + shape[1] + " rows, \n");
        stringBuffer.append("[");
        boolean notFirst = false;
        for (double[] data : dataset) {
            if (notFirst) {
                stringBuffer.append(",\n ");
            }
            notFirst = true;
            stringBuffer.append("[");

            boolean notFirstInLine = false;
            for (double record : data) {
                if (notFirstInLine) {
                    stringBuffer.append(", ");
                }
                notFirstInLine = true;
                stringBuffer.append(record);
            }
            stringBuffer.append("]");
        }
        stringBuffer.append("]");
        return stringBuffer.toString();
    }
}
